import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import router from './router.js'
Vue.use(ElementUI)


Vue.config.productionTip = false
router.beforeEach((to, from, next)=>{
  window.document.title = to.meta.title == undefined?'默认标题':to.meta.title
  if(to.fullPath==='/home'&&(from.path==='/detail'|from.path==='/'|from.path==='/search'|from.path==='/console'|from.path==='/history'|from.path==='/category'|from.path==='/ck')){
    to.meta.keepAlive= true
  }
  else{
    to.meta.keepAlive= false
  }
  next()
});

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
